/* This is a small demo of the high-performance GUIX graphics framework. */

#include <stdio.h>
#include "tx_api.h"
#include "gx_api.h"
#include "gx_validation_utility.h"
#include "gx_image_reader.h"
#include "gx_display.h"

TEST_PARAM test_parameter = {
    "guix_image_reader_jpeg_decode_no_output", /* Test name */
    0, 0, 0, 0  /* Define the coordinates of the capture area.*/
};

int main(int argc, char ** argv)
{
    /* Start ThreadX system */
    tx_kernel_enter(); 
    return(0);
}

static VOID      control_thread_entry(ULONG);

VOID tx_application_define(void *first_unused_memory)
{
    gx_validation_application_define(first_unused_memory);
    
    /* Termiante the test if it runs for more than 100 ticks */
    /* This function is not implemented yet. */
    gx_validation_watchdog_create(100);

    /* Create a dedicated thread to perform various operations
       on the line drawing example. These operations simulate 
       user input. */
    gx_validation_control_thread_create(control_thread_entry);
}


#ifdef WIN32
#undef WIN32
#endif

#include "gx_validation_wrapper.h"
#include "demo_guix_jpeg_draw_32bpp.c"

#define TEST_MEMORY_SIZE_1 1608
#define TEST_MEMORY_SIZE_2 1936
#define TEST_MEMORY_SIZE_3 3608

GX_UBYTE test_memory_1[TEST_MEMORY_SIZE_1];
GX_UBYTE test_memory_2[TEST_MEMORY_SIZE_2];
GX_UBYTE test_memory_3[TEST_MEMORY_SIZE_3];

typedef struct TEST_STRUCT{
GX_CONST GX_UBYTE *test_data;
UINT               test_data_size;
}TEST;

/* Test invalid jpeg flag. */
GX_CONST GX_UBYTE test_data_1[]={0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

/* Test invalid jpeg flag. */
GX_CONST GX_UBYTE test_data_2[]={0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

/* Unsupported precision. */
GX_CONST GX_UBYTE test_data_3[]={
    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x4e, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 
    0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x03, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x51, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
    0x51, 0x11, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x51, 0x12, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0xa0, 
    0x00, 0x01, 0x86, 0xa0, 0xff, 0xdb, 0x00, 0x43, 0xF0, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x04, 
    0x04, 0x03, 0x05, 0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x08, 0x08, 0x0a, 0x08, 0x07, 0x07, 0x0a, 0x0d, 0x0a, 0x0a, 0x0b, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x09, 
    0x0e, 0x0f, 0x0d, 0x0c, 0x0e, 0x0b, 0x0c, 0x0c, 0xfc, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 0x0c, 0x0c, 0x0c
};

/* Invalid data size. */
GX_CONST GX_UBYTE test_data_4[]={
    0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x4e, 0x45, 0x78, 0x69, 0x66, 0x00, 0x00, 0x4d, 0x4d, 
    0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x03, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x51, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
    0x51, 0x11, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x51, 0x12, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x86, 0xa0, 
    0x00, 0x01, 0x86, 0xa0, 0xff, 0xdb, 0x00, 0x43, 0xF0
};

/* Number of components = 1. */
GX_CONST GX_UBYTE test_data_5[]={
    0xff, 0xd8, 0xff, 0x00, 0xff, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x4e, 0x45, 0x78, 0x69, 0x66, 0x00, 
    0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x03, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x51, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 
    0x00, 0x00, 0x00, 0x51, 0x11, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x51, 0x12, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x01, 0x86, 0xa0, 0x00, 0x01, 0x86, 0xa0, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 0x03, 0x03, 0x03, 0x03, 
    0x03, 0x06, 0x04, 0x04, 0x03, 0x05, 0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x08, 0x08, 0x0a, 0x08, 0x07, 0x07, 0x0a, 0x0d, 0x0a, 0x0a, 0x0b, 0x0c, 0x0c, 0x0c, 
    0x0c, 0x07, 0x09, 0x0e, 0x0f, 0x0d, 0x0c, 0x0e, 0x0b, 0x0c, 0x0c, 0x0c, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 
    0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
    0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x20, 0x00, 0x20, 0x01, 0x01, 0x22, 0x00, 0x02, 0x11, 
    0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 
    0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 
    0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 
    0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 
    0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 
    0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 
    0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 
    0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 
    0xb5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 
    0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 
    0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 
    0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 
    0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd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0xff, 0x00, 0xf0, 
    0xaf, 0xbf, 0xe1, 0x5f, 0x79, 0x3f, 0xf2, 0xf5, 0xfd, 0xad, 0xf6, 0xff, 0x00, 0xb6, 0x79, 0x9f, 0xec, 0x41, 0xe5, 0xec, 0xfb, 0x27, 0xfb, 0x5b, 0xbc, 0xce, 0xdb, 0x79, 0xfc, 0x75, 0xfd, 0xa1, 
    0xbf, 0x67, 0x9f, 0xf8, 0x77, 0x5f, 0xf6, 0x3f, 0xfc, 0x4e, 0x3f, 0xe1, 0x30, 0xff, 0x00, 0x84, 0xc3, 0xce, 0xff, 0x00, 0x97, 0x4f, 0xec, 0xff, 0x00, 0xb2, 0x7d, 0x9b, 0xcb, 0xff, 0x00, 0x6e, 
    0x5d, 0xfb, 0xbe, 0xd1, 0xfe, 0xce, 0x36, 0x77, 0xcf, 0x07, 0xfc, 0xa4, 0xbf, 0xfc, 0x24, 0x66, 0xff, 0x00, 0xec, 0xdc, 0x7d, 0x86, 0xf8, 0x65, 0xfc, 0x4f, 0xed, 0x1f, 0x69, 0xef, 0x3d, 0x23, 
    0xf5, 0x7c, 0x06, 0x13, 0xea, 0x98, 0x0c, 0x3a, 0x5a, 0xb7, 0xf5, 0x8b, 0xdd, 0x5a, 0xb2, 0x6a, 0x47, 0xfc, 0x89, 0xbf, 0xe3, 0x9f, 0x3e, 0x90, 0x7e, 0xf6, 0x16, 0x5f, 0xee, 0x78, 0xcd, 0xb9, 
    0x2d, 0xfe, 0xdd, 0x88, 0xff, 0x00, 0x67, 0xc0, 0xde, 0x72, 0xe6, 0x9b, 0xa1, 0x4b, 0xf7, 0xb5, 0xf4, 0xf8, 0xe1, 0xa7, 0x3c, 0x0f, 0xff, 0xd9
};
static GX_CONST GX_UBYTE test_data_6[] =
{
    0xff, 0xd8, 0xff, 0x00, 0xff, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0xff, 0xe1, 0x00, 0x4e, 0x45, 0x78, 0x69, 0x66, 0x00, 
    0x00, 0x4d, 0x4d, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x03, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x51, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 
    0x00, 0x00, 0x00, 0x51, 0x11, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x51, 0x12, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
    0x01, 0x86, 0xa0, 0x00, 0x01, 0x86, 0xa0, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x02, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x05, 0x03, 0x03, 0x03, 0x03, 
    0x03, 0x06, 0x04, 0x04, 0x03, 0x05, 0x07, 0x06, 0x07, 0x07, 0x07, 0x06, 0x07, 0x07, 0x08, 0x09, 0x0b, 0x09, 0x08, 0x08, 0x0a, 0x08, 0x07, 0x07, 0x0a, 0x0d, 0x0a, 0x0a, 0x0b, 0x0c, 0x0c, 0x0c, 
    0x0c, 0x07, 0x09, 0x0e, 0x0f, 0x0d, 0x0c, 0x0e, 0x0b, 0x0c, 0x0c, 0x0c, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x0c, 0x08, 0x07, 0x08, 0x0c, 
    0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
    0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xff, 0xc0, 0x00, 0x11, 0x08, 0x00, 0x20, 0x00, 0x20, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 
    0x01, 0x03, 0x11, 0x01, 0xff, 0xc4, 0x00, 0x1f, 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 
    0x07, 0xff, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 0xb5, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, 0x00, 0x01, 0x7d, 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 
    0x05, 0x12, 0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07, 0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08, 0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0, 0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 
    0x0a, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 
    0x58, 0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 
    0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 
    0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xff, 0xc4, 0x00, 0x1f, 
    0x01, 0x00, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0xff, 0xc4, 0x00, 
    0xb5, 0x11, 0x00, 0x02, 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21, 0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 
    0x61, 0x71, 0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91, 0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0, 0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34, 0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 
    0x1a, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x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0x5a, 0xb7, 0xf5, 0x8b, 0xdd, 0x5a, 0xb2, 0x6a, 0x47, 0xfc, 0x89, 0xbf, 0xe3, 0x9f, 0x3e, 0x90, 0x7e, 0xf6, 0x16, 0x5f, 0xee, 0x78, 0xcd, 0xb9, 
    0x2d, 0xfe, 0xdd, 0x88, 0xff, 0x00, 0x67, 0xc0, 0xde, 0x72, 0xe6, 0x9b, 0xa1, 0x4b, 0xf7, 0xb5, 0xf4, 0xf8, 0xe1, 0xa7, 0x3c, 0x0f, 0xff, 0xd9

};
TEST test_list[]={
{test_data_1, sizeof(test_data_1)},
{test_data_2, sizeof(test_data_2)},
{test_data_3, sizeof(test_data_3)},
{test_data_4, sizeof(test_data_4)},
{GX_NULL, 0}
};

static VOID control_thread_entry(ULONG input)
{
GX_BOOL      test_successed = GX_TRUE;
int          index;
GX_PIXELMAP *map;
GX_PIXELMAP  outmap;
UINT         status;
TEST        *test = test_list;
GX_IMAGE_READER image_reader;

    /* Test decode with invalid jpeg data. */
    while(test->test_data)
    {
        _gx_image_reader_create(&image_reader, test->test_data, test->test_data_size, GX_COLOR_FORMAT_24XRGB, 0);
        status = _gx_image_reader_jpeg_decode(&image_reader, &outmap);
        if(status == GX_SUCCESS)
        {
            test_successed = GX_FALSE;
        }
        test++;
    }

    _gx_image_reader_create(&image_reader, test_data_5, sizeof(test_data_5), GX_COLOR_FORMAT_24XRGB, 0);
    _gx_image_reader_jpeg_decode(&image_reader, &outmap);

    gx_widget_pixelmap_get(&main_window, GX_PIXELMAP_ID_RED_APPLE, &map);

    /* Test decode with invalid jpeg data size. */
    _gx_image_reader_create(&image_reader, map->gx_pixelmap_data, 5, GX_COLOR_FORMAT_24XRGB, 0);
    status = _gx_image_reader_jpeg_decode(&image_reader, &outmap);
    if(status != GX_INVALID_VALUE)
    {
        test_successed = GX_FALSE;
    }

    /* Test decode with null pointer jpeg data. */
    _gx_image_reader_create(&image_reader, GX_NULL, 20, GX_COLOR_FORMAT_24XRGB, 0);
    status = _gx_image_reader_jpeg_decode(&image_reader, &outmap);
    if(status != GX_INVALID_VALUE)
    {
        test_successed = GX_FALSE;
    }

    _gx_display_driver_24xrgb_jpeg_draw(GX_NULL, 10, 10, map);

    /* Test jpeg decode with invalid huffman table, lead get number of bits more than 24. */
    _gx_image_reader_create(&image_reader, test_data_6, sizeof(test_data_6), GX_COLOR_FORMAT_24XRGB, 0);
    _gx_image_reader_jpeg_decode(&image_reader, &outmap);

    /* Test decode with different memory buffer size. */
    for(index = 0; index < 5; index++)
    {
        switch(index)
        {
        case 0:
            gx_system_memory_allocator_set(GX_NULL, GX_NULL);
            break;

        case 1:
            gx_system_memory_allocator_set(decode_memory_allocate, GX_NULL);
            break;

        case 2:
            tx_byte_pool_delete(&decode_pool);
            tx_byte_pool_create(&decode_pool, "test_memory_1", test_memory_1, TEST_MEMORY_SIZE_1);
            gx_system_memory_allocator_set(decode_memory_allocate, decode_memory_free);
            break;

        case 3:
            tx_byte_pool_delete(&decode_pool);
            tx_byte_pool_create(&decode_pool, "test_memory_2", test_memory_2, TEST_MEMORY_SIZE_2);
            break;

        case 4:
            tx_byte_pool_delete(&decode_pool);
            tx_byte_pool_create(&decode_pool, "test_memory_3", test_memory_3, TEST_MEMORY_SIZE_3);
            break;
        }

        _gx_image_reader_create(&image_reader, map->gx_pixelmap_data, map->gx_pixelmap_data_size, GX_COLOR_FORMAT_24XRGB, 0);
        status = _gx_image_reader_jpeg_decode(&image_reader, &outmap);
        if(status != GX_SYSTEM_MEMORY_ERROR)
        {
            test_successed = GX_FALSE;
        }
    }

    if(test_successed)
    {
        gx_validation_print_test_result(TEST_SUCCESS);
        exit(0);
    }
    else 
    {
        gx_validation_print_test_result(TEST_FAIL);
        exit(1);
    }
}
